package org.framework.edge.builder.controller;

import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import org.wu.framework.web.spring.EasyController;
import org.springframework.web.bind.annotation.*;
import org.wu.framework.web.response.Result;
import org.wu.framework.web.response.ResultFactory;
import org.springframework.beans.factory.annotation.Autowired;
import jakarta.annotation.Resource;
import java.util.List;
import org.framework.edge.builder.domain.model.docker.repository.backup.record.DockerRepositoryBackupRecord;
import org.framework.edge.builder.application.command.docker.repository.backup.record.DockerRepositoryBackupRecordRemoveCommand;
import org.framework.edge.builder.application.command.docker.repository.backup.record.DockerRepositoryBackupRecordStoryCommand;
import org.framework.edge.builder.application.command.docker.repository.backup.record.DockerRepositoryBackupRecordUpdateCommand;
import org.framework.edge.builder.application.command.docker.repository.backup.record.DockerRepositoryBackupRecordQueryListCommand;
import org.framework.edge.builder.application.command.docker.repository.backup.record.DockerRepositoryBackupRecordQueryOneCommand;
import org.framework.edge.builder.application.DockerRepositoryBackupRecordApplication;
import org.framework.edge.builder.application.dto.DockerRepositoryBackupRecordDTO;
import org.wu.framework.lazy.orm.database.lambda.domain.LazyPage;
import org.framework.edge.builder.application.command.docker.repository.backup.record.DockerRepositoryBackupRecordExcelExport;
import org.framework.edge.builder.application.command.docker.repository.backup.record.DockerRepositoryBackupRecordExcelImport;
import org.wu.framework.easy.excel.stereotype.RequestExcelBody;
import org.wu.framework.easy.excel.stereotype.EasyExcel;
/**
 * describe Docker仓库备份记录 
 *
 * @author Jia wei Wu
 * @date 2025/07/10 08:18 晚上
 * @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyController 
 **/
@Tag(name = "Docker仓库备份记录提供者")
@EasyController("/docker/repository/backup/record")
public class DockerRepositoryBackupRecordProvider  {

    @Resource
    private DockerRepositoryBackupRecordApplication dockerRepositoryBackupRecordApplication;

    /**
     * describe 新增Docker仓库备份记录
     *
     * @param dockerRepositoryBackupRecordStoryCommand 新增Docker仓库备份记录     
     * @return {@link Result<DockerRepositoryBackupRecord>} Docker仓库备份记录新增后领域对象     
     
     * @author Jia wei Wu
     * @date 2025/07/10 08:18 晚上
     **/

    @Operation(summary = "新增Docker仓库备份记录")
    @PostMapping("/story")
    public Result<DockerRepositoryBackupRecord> story(@RequestBody DockerRepositoryBackupRecordStoryCommand dockerRepositoryBackupRecordStoryCommand){
        return dockerRepositoryBackupRecordApplication.story(dockerRepositoryBackupRecordStoryCommand);
    }
    /**
     * describe 批量新增Docker仓库备份记录
     *
     * @param dockerRepositoryBackupRecordStoryCommandList 批量新增Docker仓库备份记录     
     * @return {@link Result<List<DockerRepositoryBackupRecord>>} Docker仓库备份记录新增后领域对象集合     
     
     * @author Jia wei Wu
     * @date 2025/07/10 08:18 晚上
     **/

    @Operation(summary = "批量新增Docker仓库备份记录")
    @PostMapping("/batchStory")
    public Result<List<DockerRepositoryBackupRecord>> batchStory(@RequestBody List<DockerRepositoryBackupRecordStoryCommand> dockerRepositoryBackupRecordStoryCommandList){
        return dockerRepositoryBackupRecordApplication.batchStory(dockerRepositoryBackupRecordStoryCommandList);
    }
    /**
     * describe 更新Docker仓库备份记录
     *
     * @param dockerRepositoryBackupRecordUpdateCommand 更新Docker仓库备份记录     
     * @return {@link Result<DockerRepositoryBackupRecord>} Docker仓库备份记录领域对象     
     
     * @author Jia wei Wu
     * @date 2025/07/10 08:18 晚上
     **/

    @Operation(summary = "更新Docker仓库备份记录")
    @PutMapping("/updateOne")
    public Result<DockerRepositoryBackupRecord> updateOne(@RequestBody DockerRepositoryBackupRecordUpdateCommand dockerRepositoryBackupRecordUpdateCommand){
        return dockerRepositoryBackupRecordApplication.updateOne(dockerRepositoryBackupRecordUpdateCommand);
    }
    /**
     * describe 查询单个Docker仓库备份记录
     *
     * @param dockerRepositoryBackupRecordQueryOneCommand 查询单个Docker仓库备份记录     
     * @return {@link Result<DockerRepositoryBackupRecordDTO>} Docker仓库备份记录DTO对象     
     
     * @author Jia wei Wu
     * @date 2025/07/10 08:18 晚上
     **/

    @Operation(summary = "查询单个Docker仓库备份记录")
    @GetMapping("/findOne")
    public Result<DockerRepositoryBackupRecordDTO> findOne(@ModelAttribute DockerRepositoryBackupRecordQueryOneCommand dockerRepositoryBackupRecordQueryOneCommand){
        return dockerRepositoryBackupRecordApplication.findOne(dockerRepositoryBackupRecordQueryOneCommand);
    }
    /**
     * describe 查询多个Docker仓库备份记录
     *
     * @param dockerRepositoryBackupRecordQueryListCommand 查询多个Docker仓库备份记录     
     * @return {@link Result<List<DockerRepositoryBackupRecordDTO>>} Docker仓库备份记录DTO对象     
     
     * @author Jia wei Wu
     * @date 2025/07/10 08:18 晚上
     **/

    @Operation(summary = "查询多个Docker仓库备份记录")
    @GetMapping("/findList")
    public Result<List<DockerRepositoryBackupRecordDTO>> findList(@ModelAttribute DockerRepositoryBackupRecordQueryListCommand dockerRepositoryBackupRecordQueryListCommand){
        return dockerRepositoryBackupRecordApplication.findList(dockerRepositoryBackupRecordQueryListCommand);
    }
    /**
     * describe 分页查询多个Docker仓库备份记录
     *
     * @param dockerRepositoryBackupRecordQueryListCommand 分页查询多个Docker仓库备份记录     
     * @return {@link Result<LazyPage<DockerRepositoryBackupRecordDTO>>} 分页Docker仓库备份记录DTO对象     
     
     * @author Jia wei Wu
     * @date 2025/07/10 08:18 晚上
     **/

    @Operation(summary = "分页查询多个Docker仓库备份记录")
    @GetMapping("/findPage")
    public Result<LazyPage<DockerRepositoryBackupRecordDTO>> findPage(@Parameter(description ="分页大小") @RequestParam(defaultValue = "10", value = "size") int size,
                           @Parameter(description ="当前页数") @RequestParam(defaultValue = "1", value = "current") int current,@ModelAttribute DockerRepositoryBackupRecordQueryListCommand dockerRepositoryBackupRecordQueryListCommand){
        return dockerRepositoryBackupRecordApplication.findPage(size,current,dockerRepositoryBackupRecordQueryListCommand);
    }
    /**
     * describe 删除Docker仓库备份记录
     *
     * @param dockerRepositoryBackupRecordRemoveCommand 删除Docker仓库备份记录     
     * @return {@link Result<DockerRepositoryBackupRecord>} Docker仓库备份记录     
     
     * @author Jia wei Wu
     * @date 2025/07/10 08:18 晚上
     **/

    @Operation(summary = "删除Docker仓库备份记录")
    @DeleteMapping("/remove")
    public Result<DockerRepositoryBackupRecord> remove(@ModelAttribute DockerRepositoryBackupRecordRemoveCommand dockerRepositoryBackupRecordRemoveCommand){
        return dockerRepositoryBackupRecordApplication.remove(dockerRepositoryBackupRecordRemoveCommand);
    }
    /**
     * describe 导出Docker仓库备份记录
     *
     * @param dockerRepositoryBackupRecordQueryListCommand 导出Docker仓库备份记录     
     * @return {@link List<DockerRepositoryBackupRecordExcelExport>} Docker仓库备份记录     
     
     * @author Jia wei Wu
     * @date 2025/07/10 08:18 晚上
     **/

    @EasyExcel(fileName = "导出Docker仓库备份记录数据")
    @Operation(summary = "导出Docker仓库备份记录")
    @GetMapping("/exportExcel")
    public List<DockerRepositoryBackupRecordExcelExport> exportExcel(@ModelAttribute DockerRepositoryBackupRecordQueryListCommand dockerRepositoryBackupRecordQueryListCommand){
        return dockerRepositoryBackupRecordApplication.exportExcel(dockerRepositoryBackupRecordQueryListCommand);
    }
    /**
     * describe 导出模版Docker仓库备份记录
     *
     
     * @return {@link Result<List<DockerRepositoryBackupRecordExcelExport>>} Docker仓库备份记录     
     
     * @author Jia wei Wu
     * @date 2025/07/10 08:18 晚上
     **/

    @EasyExcel(fileName = "导出Docker仓库备份记录模版数据")
    @Operation(summary = "导出Docker仓库备份记录模版")
    @GetMapping("/exportTemplateExcel")
    public List<DockerRepositoryBackupRecordExcelExport> exportTemplateExcel(){
        return List.of(new DockerRepositoryBackupRecordExcelExport());
    }
    /**
     * describe 导入Docker仓库备份记录
     *
     * @param dockerRepositoryBackupRecordExcelImportList 导入Docker仓库备份记录     
     * @return {@link Result<DockerRepositoryBackupRecordExcelImport>} Docker仓库备份记录     
     
     * @author Jia wei Wu
     * @date 2025/07/10 08:18 晚上
     **/

    @Operation(summary = "导入Docker仓库备份记录")
    @PostMapping("/importExcel")
    public Result<List<DockerRepositoryBackupRecordExcelImport>> importExcel(@RequestExcelBody("multipartFile") List<DockerRepositoryBackupRecordExcelImport> dockerRepositoryBackupRecordExcelImportList){
        return dockerRepositoryBackupRecordApplication.importExcel(dockerRepositoryBackupRecordExcelImportList);
    }
}